function sub(){
    console.log('-----表单提交哦了------');
    let form =document.getElementById('form')
    form.onsubmit()


    let username=document.getElementsByName("username")[0]
    console.log(form);
    console.log(username);
  /*  *if(username){
        
        let usernameValue=username.Value

        console.log(usernameValue);
        if(usernameValue.length>0){
            return true
        }
        return false 
    }

    return true
 */
}



function btnClick(){
    let mylike=document.getElementById('mylike');
    let val=mylike.value;
    mylike.value='sc';
    console.log(val);
}



function callback(){
    console.log('Done')
}

console.log(' before setTimeout()');
setTimeout(callback,2000); //2秒之后调用callbake函数

console.log('after setTimeout()')

//在Chrome的控制台输出可以看到：

/*before setTimeout()
after setTimeout()
(等待2秒后)*/